<?php
session_start();
require_once 'header.php';
function __autoload($className)
	{
    	require_once('class/' . $className . '.class.php');
	}
session::need_member();
session::need_isset($_GET, "orderhistory.php");
if(session::is_manager()==TRUE)
{
	
	$ArrGet=$_GET;
	$UserId=intval($ArrGet['userid']);
	$OrderId=intval($ArrGet['orderid']);
}
else if(session::is_member()==TRUE)
{
	$ArrGet=$_GET;
	$OrderId=intval($ArrGet['orderid']);
	$UserId=session::getuserid();
}
	$condition=array(
	'orderid' => $OrderId,
	'userid' => $UserId
	);
$GetCcInfo=database::LimitQuery('ccinfo',array(
'condition' => $condition,
'order' => 'order by ccid'
));
$id=0;
foreach($GetCcInfo as $change)
{
	$cc=$change['ccnumber'];
	$exm=$change['exmonth'];
	$exy=$change['exyear'];
	$ccv=$change['ccv2'];
	$ccnumhash=hash::unhash($cc, $exm, $exy, $ccv);
	$GetCcInfo[$id]['ccnum']=$ccnumhash;
	$id++;
}
require_once('html/orderdetail.php');
?>